<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="${pageContext.request.contextPath}/css/normalize.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/css/Header.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="head">
    <div class="userImg">
        <img src="${pageContext.request.contextPath}/image/1.png" alt="">

        <div class="bot">
            <ul>
                <li><a class="active" target="_parent"
                       href="${pageContext.request.contextPath}/SupplierServlet">供应商申请查询</a></li>
                <li><a target="_parent" href="${pageContext.request.contextPath}/SupplierServlet">供应商-申请信息</a>
                </li>
                <li><a target="_parent" href="${pageContext.request.contextPath}/CompanyServlet">供应商-基础信息</a>
                </li>
                <li><a target="_parent" href="${pageContext.request.contextPath}/MarketServlet">供应商-市场信息</a></li>
                <li><a target="_parent" href="${pageContext.request.contextPath}/ShareholderServlet">供应商-股东信息</a>
                </li>
                <li><a target="_parent" href="${pageContext.request.contextPath}/ContactsServlet">供应商-联系人信息</a>
                </li>
                <li><a target="_parent" href="${pageContext.request.contextPath}/BankServlet">供应商-收款信息</a></li>
            </ul>
        </div>
    </div>
    <div class="username" style="font-weight: 700;">张三</div>
</div>

<script>
    var a = document.querySelectorAll('li a');

    window.addEventListener('message', (e) => {
        console.log(e.data);
        for (let i = 0; i < a.length; i++) {
            if (a[i].href.substr(a[i].href.lastIndexOf('/')) == e.data) {
                a[i].className = 'active'
            }
        }
    }, false);
</script>
</body>
</html>